<style type="text/css">
    .layui-form-select dl{z-index:9999;}
</style>
<form class="layui-form" action="{:url()}" method="post" id="editForm">
    
    <div class="layui-form-item">
        <button type="button" class="layui-btn" id="upimg">
            <i class="layui-icon">&#xe67c;</i>上传文件
        </button>
    </div>
    <!-- <div class="layui-form-item">
        <label class="layui-form-label">状态设置</label>
        <div class="layui-input-inline">
            <input type="radio" class="field-nPow" name="nPow" value="0" title="禁用" checked>
            <input type="radio" class="field-nPow" name="nPow" value="1" title="启用">
        </div>
    </div> -->
    <div class="layui-form-item">
        <div class="layui-input-block">
            <input type="hidden" class="field-id" name="id">
            <!-- <button type="submit" class="layui-btn layui-btn-normal" hisi-data="{pop: true, refresh: true}" lay-submit="" lay-filter="formSubmit">提交</button> -->
            <a href="javascript:parent.layui.layer.closeAll();" class="layui-btn layui-btn-primary ml10">取消</a>
        </div>
    </div>
</form>
{include file="system@block/layui" /}
<script>
layui.use(['func'], function() {
    // 编辑模式下表单自动赋值
    layui.func.assign({:json_encode($formData)});
});
</script>

<script src="/static/build/layui.js"></script>
<script>
layui.use('upload', function(){
  var upload = layui.upload;
   
  //执行实例
  var uploadInst = upload.render({
    elem: '#upimg' //绑定元素
    ,url: 'upload' //上传接口
    ,done: function(res){
      //上传完毕回调
      if(res.code==1){
        //   alert('上传成功');
        //   window.location.href="{:url('files/index')}";
        parent.location.reload()
      }
    }
    ,error: function(){
      //请求异常回调
    }
  });
});
</script>